
capture log close
log using $log/AED_analysis_11_prediction, text replace


/* ------------------------------------------------------------------------------------ */
/* --- Estimation results Table A.12  ------------------------------------------------- */
/* ------------------------------------------------------------------------------------ */

clear
clear matrix
clear mata
set maxvar 10000
set matsize 2000
set more off

set trace off
   
			
				
#d;
global xvars_pred " vac_rate aloq   
				share_agriculture_avg share_industry_avg share_service_avg wanderungen_avg bip_avg 
				iza_alter_kat1 iza_alter_kat2 iza_alter_kat3 iza_alter_kat4 iza_sex iza_famstd
				i.iza_kind i.iza_abschluss_kat i.iza_ausb_kat
				iza_last_daily_income  
				iza_ende_last sv_last5 alo_last5
				i.year i.entry_m";
				#d cr				
	

	

		use $data/data_est_border, clear
		bys iza_id: keep if _n==1
		
	egen sv_last5 = rsum(iza_sv_tminus1 iza_sv_tminus2 iza_sv_tminus3 iza_sv_tminus4 iza_sv_tminus5)
	egen alo_last5 = rsum(iza_alo_tminus1 iza_alo_tminus2 iza_alo_tminus3 iza_alo_tminus4 iza_alo_tminus5)
	
	
	logit iza_umzug24 $xvars_pred if eintritt>=200506 & eintritt<=200705
	predict moving_prob
	margins, dydx(*)
	


log close
